import { http } from '@/utils'

export type DepartmentItem = {
  id: number
  createTime: string
  updateTime: string
  name: string
  parentId: number | null
  parentName: string | null
  orderNum: number
}

export type UserItem = {
  id: number
  name: string
  nickName: string
  headImg: string
  email: string | null
  remark: string | null
  status: 0 | 1
  createTime: string
  updateTime: string
  username: string
  phone: string | null
  roleName: string
  departmentId: string
  departmentName: string
}

/** 获取部门列表数据 */
export function getDepartmentList() {
  return http.post<DepartmentItem[]>('/admin/base/sys/department/list')
}
